﻿using System.Net;

namespace Future.Web.Controllers
{
    /// <summary>
    /// 首页
    /// </summary>
    [Route("/")]
    public class HomeController : ControllerBase
    {
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ContentResult Index()
        {
            string path = Path.GetDirectoryName(typeof(Program).Assembly.Location) ?? string.Empty;
            path = Path.Combine(path, "View/Index.html");
            string content = System.IO.File.ReadAllText(path);
            return new ContentResult
            {
                ContentType = "text/html",
                StatusCode = (int)HttpStatusCode.OK,
                Content = content
            };
        }
    }
}
